package com.xlink.service.impl;

import com.xlink.dto.Datapoint;
import com.xlink.repository.DatapointRepository;
import com.xlink.service.DatapointService;
import org.moon.base.service.AbstractService;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by jk on 2015/12/23.
 */
@Repository
@Service  //* 将服务实现类交由Spring容器管理，使用`@Service`标示
public class DatapointServiceImpl extends AbstractService implements DatapointService {
    @Resource
    private DatapointRepository datapointRepository;

    @Override
    public List<Map<String, Object>> list(Datapoint datapoint) {
        return datapointRepository.list(datapoint);
    }

    @Override
    public boolean add(Datapoint datapoint) {
        return datapointRepository.add(datapoint)>0;
    }

    @Override
    public boolean delete(Datapoint datapoint) {
        return datapointRepository.delete(datapoint)>0;
    }

    @Override
    public boolean update(Datapoint datapoint) {
        return datapointRepository.update(datapoint)>0;
    }

    @Override
    public Map<String, Object> get(Datapoint datapoint) {
        return datapointRepository.get(datapoint);
    }

    @Override
    public Map<String, Object> getnew(Datapoint datapoint) {
        return datapointRepository.getnew(datapoint);
    }



}
